From: Richard M. Stallman Date: Tue, 1 Jun 1993 18:02:02 +0000 (+0000) Subject: (dired-compress-file): Use gzip when proper/possible. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~95662 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=e251a1fdf485bc9056493ada04f66139dfc1994a;p=emacs.git (dired-compress-file): Use gzip when proper/possible. --- diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 3d2f477962c..e452bf26c61 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -486,14 +486,26 @@ and use this command with a prefix argument (the value does not matter)." (funcall handler 'dired-compress-file file)) ((file-symlink-p file) nil) - ((string-match "\\.Z$" file) + ((let (case-fold-search) + (string-match "\\.Z$" file)) (if (not (dired-check-process (concat "Uncompressing " file) "uncompress" file)) (substring file 0 -2))) + ((let (case-fold-search) + (string-match "\\.gz$" file)) + (if (not (dired-check-process (concat "Uncompressing " file) + "gunzip" file)) + (substring file 0 -3))) (t - (if (not (dired-check-process (concat "Compressing " file) - "compress" "-f" file)) - (concat file ".Z")))))) + ;;; Try gzip; if we don't have that, use compress. + (condition-case nil + (if (not (dired-check-process (concat "Compressing " file) + "gzip" "-f" file)) + (concat file ".gz")) + (file-error + (if (not (dired-check-process (concat "Compressing " file) + "compress" "-f" file)) + (concat file ".Z")))))))) (defun dired-mark-confirm (op-symbol arg) ;; Request confirmation from the user that the operation described